package com.zj.leetcode.easy.binarySearch;

/**
 * @program: algorithm
 * @description:
 * 第一个错误的版本
 * 278 first-bad-version
 * @author: Zhang Bo
 * @create: 2022-01-14 17:05
 **/
public class FirstBadVersion{
    public static void main(String[] args) {
//        Solution solution = new FirstBadVersion().new Solution();
    }
    //leetcode submit region begin(Prohibit modification and deletion)
/* The isBadVersion API is defined in the parent class VersionControl.
      boolean isBadVersion(int version); */

//    public class Solution extends VersionControl {
//        public int firstBadVersion(int n) {
//            int left = 1;
//            int right = n;
//            int mid ;
//            while(left < right){
//                mid = left + (right-left)/2;
//                if (isBadVersion(mid)){
//                    right = mid;
//                }else{
//                    left = mid + 1;
//                }
//            }
//            return right;
//        }
//    }
//leetcode submit region end(Prohibit modification and deletion)

}